package com.online_mall.shoppingCart.controller;

import com.online_mall.shoppingCart.entity.ShoppingCart;
import com.online_mall.shoppingCart.service.ShoppingCartService;
import com.online_mall.uitl.ResultFormat;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (ShoppingCart)表控制层
 *
 * @author makejava
 * @since 2025-09-02 15:03:38
 */
@RestController
@RequestMapping("shoppingCart")
public class ShoppingCartController {
    /**
     * 服务对象
     */
    @Resource
    private ShoppingCartService shoppingCartService;


    @RequestMapping(value = "/queryAllShoppingCart",method = RequestMethod.GET)
    public ResultFormat queryAllShoppingCart(ShoppingCart shoppingCart){
        return shoppingCartService.queryAll(shoppingCart);
    }

    @RequestMapping(value = "/insertShoppingCart",method = RequestMethod.GET)
    public ResultFormat insertShoppingCart(ShoppingCart shoppingCart){
        return shoppingCartService.insert(shoppingCart);
    }

    @RequestMapping(value = "/updateShoppingCart",method = RequestMethod.GET)
    public ResultFormat updateShoppingCart(ShoppingCart shoppingCart){
        return shoppingCartService.update(shoppingCart);
    }

    @RequestMapping(value = "/deleteShoppingCart",method = RequestMethod.GET)
    public ResultFormat deleteShoppingCart(ShoppingCart shoppingCart){
        return shoppingCartService.delete(shoppingCart);
    }

    @RequestMapping(value = "/buyShoppingCart",method = RequestMethod.GET)
    public ResultFormat buyShoppingCart(ShoppingCart shoppingCart){
        return shoppingCartService.buy(shoppingCart);
    }
}